Skip to content

Failed

Scenario: Birth message handling from an existing device.When I login as user with name "kapua-sys" and password "kapua-password" (from org.eclipse.kapua.service.device.integration.RunDeviceI9nTest)

Failing for the past 3 builds (Since Unstable #1 )
Took 0 ms.

Error Message

An internal error occurred: org.apache.shiro.ShiroException: Error while find user!.

Stacktrace

org.eclipse.kapua.KapuaException: An internal error occurred: org.apache.shiro.ShiroException: Error while find user!.
Caused by: org.apache.shiro.authc.AuthenticationException: org.apache.shiro.ShiroException: Error while find user!
Caused by: org.apache.shiro.ShiroException: Error while find user!
Caused by: org.eclipse.kapua.KapuaException: An internal error occurred: Error during Persistence Operation.
Caused by: javax.persistence.PersistenceException: 
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.3.v20160428-59c81c5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "SET MODE MYSQL:[*]                       b "; SQL statement:
SET MODE MySQL://localhost:3306/kapuadb [42000-192]
Error Code: 42000
Caused by: org.eclipse.persistence.exceptions.DatabaseException: 

Internal Exception: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "SET MODE MYSQL:[*]                       b "; SQL statement:
SET MODE MySQL://localhost:3306/kapuadb [42000-192]
Error Code: 42000
Caused by: org.h2.jdbc.JdbcSQLException: 
Syntax error in SQL statement "SET MODE MYSQL:[*]                       b "; SQL statement:
SET MODE MySQL://localhost:3306/kapuadb [42000-192]

Standard Output

10:51:27.542 [main] INFO  o.e.k.s.user.steps.UserServiceSteps - Logging out in cleanup
10:51:27.542 [main] INFO  o.e.k.c.c.KapuaConfigurableServiceSchemaUtilsWithResources - Running database script from resources...
10:51:27.542 [main] INFO  o.e.k.c.jpa.SimpleSqlScriptExecutor - Running resources script: database/all_delete.sql
10:51:27.543 [main] INFO  o.e.k.c.c.KapuaConfigurableServiceSchemaUtilsWithResources - ...database scripts from resources done!
10:51:27.543 [main] INFO  o.e.k.c.c.KapuaConfigurableServiceSchemaUtilsWithResources - Running database script from resources...
10:51:27.544 [main] INFO  o.e.k.c.jpa.SimpleSqlScriptExecutor - Running resources script: database/all_delete.sql
10:51:27.544 [main] INFO  o.e.k.c.c.KapuaConfigurableServiceSchemaUtilsWithResources - ...database scripts from resources done!
10:51:27.545 [main] INFO  o.eclipse.kapua.qa.steps.BasicSteps - Wait multiplier active: 4.0
10:51:27.545 [main] INFO  org.eclipse.kapua.qa.steps.DBHelper - Setting up mock database
10:51:27.551 [main] INFO  org.reflections.Reflections - Reflections took 2 ms to scan 12 urls, producing 839 keys and 852 values 
10:51:27.600 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - Executing pre master files...
10:51:27.600 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 	Master Liquibase files found: 3
10:51:27.600 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 		Excuting liquibase script: /tmp/genie.kapua/kapua-liquibase/changelog-authorization-master.pre.xml
10:51:27.617 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 		Excuting liquibase script: /tmp/genie.kapua/kapua-liquibase/changelog-event-store-master.pre.xml
10:51:27.631 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 		Excuting liquibase script: /tmp/genie.kapua/kapua-liquibase/changelog-system-configurations-master.pre.xml
10:51:27.645 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - Executing pre master files... DONE!
10:51:27.645 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - Executing master files...
10:51:27.645 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 	Master Liquibase files found: 10
10:51:27.645 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 		Excuting liquibase script: /tmp/genie.kapua/kapua-liquibase/changelog-account-master.xml
10:51:27.678 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 		Excuting liquibase script: /tmp/genie.kapua/kapua-liquibase/changelog-authentication-master.xml
10:51:27.717 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 		Excuting liquibase script: /tmp/genie.kapua/kapua-liquibase/changelog-authorization-master.xml
10:51:27.841 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 		Excuting liquibase script: /tmp/genie.kapua/kapua-liquibase/changelog-broker-master.xml
10:51:27.858 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 		Excuting liquibase script: /tmp/genie.kapua/kapua-liquibase/changelog-datastore-master.xml
10:51:27.873 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 		Excuting liquibase script: /tmp/genie.kapua/kapua-liquibase/changelog-device-management-master.xml
10:51:27.888 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 		Excuting liquibase script: /tmp/genie.kapua/kapua-liquibase/changelog-device-master.xml
10:51:27.972 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 		Excuting liquibase script: /tmp/genie.kapua/kapua-liquibase/changelog-stream-master.xml
10:51:27.983 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 		Excuting liquibase script: /tmp/genie.kapua/kapua-liquibase/changelog-tag-master.xml
10:51:28.004 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 		Excuting liquibase script: /tmp/genie.kapua/kapua-liquibase/changelog-user-master.xml
10:51:28.034 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - Executing master files... DONE!
10:51:28.034 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - Executing post master files...
10:51:28.034 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - 	Master Liquibase files found: 0
10:51:28.034 [main] INFO  o.e.k.s.l.KapuaLiquibaseClient - Executing post master files... DONE!

  Scenario: Birth message handling from a new device                         # features/device/DeviceServiceI9n.feature:26
      A birth message is received. The referenced device does not yet exist and is created on-the-fly. After the
      message is processed a new device must be created and a BIRTH event inserted in the database.

    When I login as user with name "kapua-sys" and password "kapua-password" # UserServiceSteps.loginUser(String,String)
      org.eclipse.kapua.KapuaException: An internal error occurred: org.apache.shiro.ShiroException: Error while find user!.
      	at org.eclipse.kapua.KapuaException.internalError(KapuaException.java:138)
      	at org.eclipse.kapua.service.authentication.shiro.AuthenticationServiceShiroImpl.handleTokenLoginException(AuthenticationServiceShiroImpl.java:358)
      	at org.eclipse.kapua.service.authentication.shiro.AuthenticationServiceShiroImpl.login(AuthenticationServiceShiroImpl.java:154)
      	at org.eclipse.kapua.service.user.steps.UserServiceSteps.loginUser(UserServiceSteps.java:229)
      	at ✽.When I login as user with name "kapua-sys" and password "kapua-password"(features/device/DeviceServiceI9n.feature:30)
      Caused by: org.apache.shiro.authc.AuthenticationException: org.apache.shiro.ShiroException: Error while find user!
      	at org.eclipse.kapua.service.authentication.shiro.KapuaAuthenticator.doMultiRealmAuthentication(KapuaAuthenticator.java:85)
      	at org.apache.shiro.authc.pam.ModularRealmAuthenticator.doAuthenticate(ModularRealmAuthenticator.java:269)
      	at org.apache.shiro.authc.AbstractAuthenticator.authenticate(AbstractAuthenticator.java:198)
      	at org.apache.shiro.mgt.AuthenticatingSecurityManager.authenticate(AuthenticatingSecurityManager.java:106)
      	at org.apache.shiro.mgt.DefaultSecurityManager.login(DefaultSecurityManager.java:270)
      	at org.apache.shiro.subject.support.DelegatingSubject.login(DelegatingSubject.java:256)
      	at org.eclipse.kapua.service.authentication.shiro.AuthenticationServiceShiroImpl.login(AuthenticationServiceShiroImpl.java:138)
      	at org.eclipse.kapua.service.user.steps.UserServiceSteps.loginUser(UserServiceSteps.java:229)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at cucumber.runtime.Utils$1.call(Utils.java:37)
      	at cucumber.runtime.Timeout.timeout(Timeout.java:13)
      	at cucumber.runtime.Utils.invoke(Utils.java:31)
      	at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
      	at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
      	at cucumber.runtime.Runtime.runStep(Runtime.java:299)
      	at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
      	at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
      	at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
      	at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
      	at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
      	at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
      	at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93)
      	at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at cucumber.api.junit.Cucumber.run(Cucumber.java:98)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:272)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:236)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:386)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:323)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:143)
      Caused by: org.apache.shiro.ShiroException: Error while find user!
      	at org.eclipse.kapua.service.authentication.shiro.realm.UserPassAuthenticatingRealm.doGetAuthenticationInfo(UserPassAuthenticatingRealm.java:103)
      	at org.apache.shiro.realm.AuthenticatingRealm.getAuthenticationInfo(AuthenticatingRealm.java:568)
      	at org.eclipse.kapua.service.authentication.shiro.KapuaAuthenticator.doMultiRealmAuthentication(KapuaAuthenticator.java:58)
      	... 46 more
      Caused by: org.eclipse.kapua.KapuaException: An internal error occurred: Error during Persistence Operation.
      	at org.eclipse.kapua.KapuaException.internalError(KapuaException.java:123)
      	at org.eclipse.kapua.commons.util.KapuaExceptionUtils.convertPersistenceException(KapuaExceptionUtils.java:113)
      	at org.eclipse.kapua.commons.jpa.EntityManagerSession.internalOnResult(EntityManagerSession.java:152)
      	at org.eclipse.kapua.commons.jpa.EntityManagerSession.onResult(EntityManagerSession.java:118)
      	at org.eclipse.kapua.service.user.internal.UserServiceImpl.findByName(UserServiceImpl.java:228)
      	at org.eclipse.kapua.service.authentication.shiro.realm.UserPassAuthenticatingRealm.lambda$doGetAuthenticationInfo$0(UserPassAuthenticatingRealm.java:99)
      	at org.eclipse.kapua.commons.security.KapuaSecurityUtils.doPrivileged(KapuaSecurityUtils.java:110)
      	at org.eclipse.kapua.service.authentication.shiro.realm.UserPassAuthenticatingRealm.doGetAuthenticationInfo(UserPassAuthenticatingRealm.java:99)
      	... 48 more
      Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.3.v20160428-59c81c5): org.eclipse.persistence.exceptions.DatabaseException
      Internal Exception: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "SET MODE MYSQL:[*]                       b "; SQL statement:
      SET MODE MySQL://localhost:3306/kapuadb [42000-192]
      Error Code: 42000
      	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:815)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:205)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:305)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:337)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:303)
      	at org.eclipse.kapua.commons.jpa.AbstractEntityManagerFactory.createEntityManager(AbstractEntityManagerFactory.java:96)
      	at org.eclipse.kapua.commons.jpa.EntityManagerSession.internalOnResult(EntityManagerSession.java:138)
      	... 53 more
      Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.3.v20160428-59c81c5): org.eclipse.persistence.exceptions.DatabaseException
      Internal Exception: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "SET MODE MYSQL:[*]                       b "; SQL statement:
      SET MODE MySQL://localhost:3306/kapuadb [42000-192]
      Error Code: 42000
      	at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:331)
      	at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:326)
      	at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:138)
      	at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
      	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:207)
      	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:760)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:265)
      	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:731)
      	... 59 more
      Caused by: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "SET MODE MYSQL:[*]                       b "; SQL statement:
      SET MODE MySQL://localhost:3306/kapuadb [42000-192]
      	at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
      	at org.h2.message.DbException.get(DbException.java:179)
      	at org.h2.message.DbException.get(DbException.java:155)
      	at org.h2.message.DbException.getSyntaxError(DbException.java:191)
      	at org.h2.command.Parser.getSyntaxError(Parser.java:530)
      	at org.h2.command.Parser.prepareCommand(Parser.java:257)
      	at org.h2.engine.Session.prepareLocal(Session.java:560)
      	at org.h2.engine.Session.prepareCommand(Session.java:501)
      	at org.h2.engine.Engine.openSession(Engine.java:203)
      	at org.h2.engine.Engine.createSessionAndValidate(Engine.java:154)
      	at org.h2.engine.Engine.createSession(Engine.java:137)
      	at org.h2.engine.Engine.createSession(Engine.java:27)
      	at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:349)
      	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:118)
      	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:102)
      	at org.h2.Driver.connect(Driver.java:72)
      	at java.sql.DriverManager.getConnection(DriverManager.java:664)
      	at java.sql.DriverManager.getConnection(DriverManager.java:208)
      	at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
      	... 64 more

    Given Account                                                            # UserServiceSteps.givenAccount(TestAccount>)
    And I configure user service                                             # UserServiceSteps.setUserServiceConfig(TestConfig>)
    Given User A                                                             # UserServiceSteps.givenUserA(TestUser>)
    And I configure the device service                                       # DeviceServiceSteps.setDeviceServiceConfig(TestConfig>)
    And A birth message from device "device_1"                               # DeviceServiceSteps.createABirthMessage(String)
    When I search for the device "device_1" in account "AccountA"            # DeviceServiceSteps.searchForDeviceWithClientID(String,String)
    Then I find 1 device                                                     # DeviceServiceSteps.checkDeviceListLength(int)
    When I search for events from device "device_1" in account "AccountA"    # DeviceServiceSteps.searchForEventsFromDeviceWithClientID(String,String)
    Then I find 1 event                                                      # DeviceServiceSteps.checkEventListLength(int)
    And The type of the last event is "BIRTH"                                # DeviceServiceSteps.checkLastEventType(String)
    And I logout                                                             # UserServiceSteps.logout()
10:51:28.037 [main] INFO  eclipselink.logging.all - EclipseLink, version: Eclipse Persistence Services - 2.6.3.v20160428-59c81c5
10:51:28.037 [main] ERROR eclipselink.logging.ejb - Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.3.v20160428-59c81c5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "SET MODE MYSQL:[*]                       b "; SQL statement:
SET MODE MySQL://localhost:3306/kapuadb [42000-192]
Error Code: 42000
An unexpected exception was raised!